<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>Login</title>
    
    <link rel="stylesheet" type="text/css" href="css/login_style.css">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript">
	function ReShowCode(){
		var SafeCodeImg = document.getElementById("SafeCodeImg");
		SafeCodeImg.innerHTML="";
		var timeID = setTimeout("ShowCode()",500);
	}
	function ShowCode(){
		var SafeCodeImg = document.getElementById('SafeCodeImg');
		var url="/hnust/mCaptcha?"+Math.random();
		var htmlurl="<img src=\'"+url+"\' align=\'absmiddle\'  width='80' height='25' onclick=ReShowCode();>'";
		SafeCodeImg.innerHTML=htmlurl;
	}
	</script>

  </head>
  
  <body >

    <section class="container" >
    <div class="login">
      <h1>Login</h1>
      <form method="post" action="/hnust/mainframe.html" >
        <p><input type="text"  name="USERNAME"  id="userAccount"  placeholder="Student Number" value="1305010216"></p>
        <p><input type="password" name="PASSWORD" id="userPassword" placeholder="Password" value="220072"></p>
        <p>
        <input type="text"  name="CAPTCHA"  id="userAccount" value="" placeholder="Captcha" style="width: 150px">
        <span id="SafeCodeImg"><img src="/hnust/mCaptcha" style="width:80px;height:25px;"  onclick="ReShowCode()"/></span>
        </p>
        
        <p class="remember_me">
          <label>
            <input type="checkbox" name="remember_me"  id="remember_me" onselect="">Remember Me
          </label>
        </p>
        <p class="submit"><input type="submit" name="btn" value="Enter" ></p>
<%
	String mess = (String)request.getSession().getAttribute("login_message");         // 获取错误属性
	if(mess != null) {
		out.println("<font color='red'>"+mess+"</font>");
	}
%>
      </form>
    </div>
    <div class="login-help">
        <p><a href="register.jsp">Click to Register</a></p>
  		<p><a href="index.jsp">Forget the Password? </a></p>
    </div>
  </section>
<div style="text-align:center;">
	<p>Powder by:<a href="http://blog.sina.com.cn/ariceone" target="_blank">Arice</a></p>
</div>
  </body>
  
</html>